/*
 * @Description: 相关文章 - item
 * @Date: 2020-09-10 17:50:51
 * @Author: 黄治恩
 */

import React, { Component } from 'react'
import { Link } from 'react-router-dom'

// 点赞/评论
import DeatilOperation from '@/components/Operation/Detail-operation'

import './style.scss'

interface Props_type {
  info:{id:number,name:string}
}

class RelatedItem extends Component<Props_type>{

  state = {
    info:this.props.info
  }

  render() {
    let { info } = this.state

    return (
      <Link to={`/article?id=${info.id}`} className="related-item" target="_blank">
        <h4 className="item-title">
          {info.name || ''}
        </h4>
        <DeatilOperation />
      </Link>
    )
  }
}

export default RelatedItem